﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using spbtzb;

public partial class UserControls_Network : System.Web.UI.UserControl
{
    //protected string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='E://spbtzb.mdb';";
    protected string strConnection = spbtzb.ConString.ConnString;

    protected void Page_Load(object sender, EventArgs e)
    {
        BindControl();
    }

    protected string CutString(string InputString, int Length)
    {
        return Common.CutString(InputString, Length);
    }

    protected void BindControl()
    {
        /*
        rpNotice.DataSource = AccessHelper.ExecuteDataTable(strConnection, CommandType.Text,
        "SELECT TOP 4 C.ID, C.Title, C.CreateTime FROM Contents C ,ContentAndType CT" +
        " WHERE CT.ContentType = 'HLKD' AND CT.ContentID=C.ID Order By C.CreateTime DESC,C.ID DESC");
         */
        rpNotice.DataSource = AccessHelper.ExecuteDataTable(strConnection, CommandType.Text,
            "SELECT TOP 5  *  FROM FileList where IsDisplay = true ");
        rpNotice.DataBind();
    }

    protected string ConvertTime(object obj)
    {
        if (obj is Nullable)
            return "";
        try
        {
            DateTime dt = DateTime.Parse(obj.ToString());
            return "(" + dt.Year.ToString() + "-" + dt.Month.ToString() + "-" + dt.Day.ToString() + ")";
        }
        catch { }
        return "";

    }
}
